<?php

/**
 * SimplifyPHP Framework
 *
 * This file is part of SimplifyPHP Framework.
 *
 * SimplifyPHP Framework is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3 of the License, or
 * (at your option) any later version.
 *
 * SimplifyPHP Framework is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @author Rodrigo Rutkoski Rodrigues, <rutkoski@gmail.com>
 */

/**
 * 
 * @author "Rodrigo Rutkoski Rodrigues, <rutkoski@gmail.com>"
 *
 */
class AssociationDefinition
{

  protected $params;

  protected $paramNames = array(
    'foreignKey', 'primaryKey', 'sourceTable', 'targetTable', 'associationTable', 'associationForeignKey', 'associationPrimaryKey' 
  );

  public function __construct($params = null)
  {
    $this->params = new ParameterHolder($params);
  }

  /**
   * Get the parameter holder.
   *
   * @return ParameterHolder
   */
  public function getParameters()
  {
    return $this->params;
  }

  /**
   * @param $associationPrimaryKey the $associationPrimaryKey to set
   */
  public function setAssociationPrimaryKey($associationPrimaryKey)
  {
    $this->params->set('associationPrimaryKey', $associationPrimaryKey);
  }

  /**
   * @param $associationForeignKey the $associationForeignKey to set
   */
  public function setAssociationForeignKey($associationForeignKey)
  {
    $this->params->set('associationForeignKey', $associationForeignKey);
  }

  /**
   * @param $associationTable the $associationTable to set
   */
  public function setAssociationTable($associationTable)
  {
    $this->params->set('associationTable', $associationTable);
  }

  /**
   * @param $targetTable the $targetTable to set
   */
  public function setTargetTable($targetTable)
  {
    $this->params->set('targetTable', $targetTable);
  }

  /**
   * @param $sourceTable the $sourceTable to set
   */
  public function setSourceTable($sourceTable)
  {
    $this->params->set('sourceTable', $sourceTable);
  }

  /**
   * @param $primaryKey the $primaryKey to set
   */
  public function setPrimaryKey($primaryKey)
  {
    $this->params->set('primaryKey', $primaryKey);
  }

  /**
   * @param $foreignKey the $foreignKey to set
   */
  public function setForeignKey($foreignKey)
  {
    $this->params->set('foreignKey', $foreignKey);
  }

  /**
   * @return the $associationPrimaryKey
   */
  public function getAssociationPrimaryKey()
  {
    return $this->params->get('associationPrimaryKey');
  }

  /**
   * @return the $associationForeignKey
   */
  public function getAssociationForeignKey()
  {
    return $this->params->get('associationForeignKey');
  }

  /**
   * @return the $associationTable
   */
  public function getAssociationTable()
  {
    return $this->params->get('associationTable');
  }

  /**
   * @return the $targetTable
   */
  public function getTargetTable()
  {
    return $this->params->get('targetTable');
  }

  /**
   * @return the $sourceTable
   */
  public function getSourceTable()
  {
    return $this->params->get('sourceTable');
  }

  /**
   * @return the $primaryKey
   */
  public function getPrimaryKey()
  {
    return $this->params->get('primaryKey');
  }

  /**
   * @return the $foreignKey
   */
  public function getForeignKey()
  {
    return $this->params->get('foreignKey');
  }

}

?>